#include <stdio.h>

const char WHITE = 'w';
const char BLACK = 'b';
const char EMPTY = 'e';

const int MAX_N = 499;
char tussocks[ 2*MAX_N + 1 ];
int N = 0;
int TussocksCnt = 0;

const int MAX_STEPS_CNT = 1000 * 1000;
int Steps[ MAX_STEPS_CNT + 1 ];
int StepsCnt = 0;

void InitTussocks()
{
	for( int i = 0; i < N; ++i )
		tussocks[i] = WHITE;

	tussocks[N] = EMPTY;

	for( int i = N+1; i < TussocksCnt; ++i )
		tussocks[i] = BLACK;
}

bool SwapToTheRight( int start_pos = TussocksCnt-2 )
{
	bool step_happened = false;
	for( int i = start_pos; i >= 0; --i )
	{
		if( tussocks[i] != WHITE )
			continue;

		if( tussocks[i+1] == BLACK )
		{
			if( i < (TussocksCnt-2) && tussocks[i+2] == EMPTY )
			{
				tussocks[i] = EMPTY;
				tussocks[i+2] = WHITE;
				Steps[ StepsCnt++ ] = i;
				if( StepsCnt > MAX_STEPS_CNT )
					return false;
			}
		}
		else if( tussocks[i+1] == EMPTY && !step_happened )
		{
			tussocks[i] = EMPTY;
			tussocks[i+1] = WHITE;
			step_happened = true;
			Steps[ StepsCnt++ ] = i;
			if( StepsCnt > MAX_STEPS_CNT )
				return false;
		}
	}
	return true;
}

bool SwapToTheLeft( int start_pos = 1 )
{
	bool step_happened = false;
	for( int i = 1; i < TussocksCnt; ++i )
	{
		if( tussocks[i] != BLACK )
			continue;

		if( tussocks[i-1] == WHITE )
		{
			if( i > 1 && tussocks[i-2] == EMPTY )
			{
				tussocks[i] = EMPTY;
				tussocks[i-2] = BLACK;
				Steps[ StepsCnt++ ] = i;
				if( StepsCnt > MAX_STEPS_CNT )
					return false;
			}
		}
		else if( tussocks[i-1] == EMPTY && !step_happened )
		{
			tussocks[i] = EMPTY;
			tussocks[i-1] = BLACK;
			step_happened = true;
			Steps[ StepsCnt++ ] = i;
			if( StepsCnt > MAX_STEPS_CNT )
				return false;
		}
	}
	return true;
}

void ShowTussocks()
{
	printf( "\n-------\n" );
	for( int i = 0; i < TussocksCnt; ++i )
		printf( "%c", tussocks[i] );
	printf( "\n-------\n" );
}

int main()
{
	scanf( "%d", &N );
	TussocksCnt = 2 * N + 1;
	InitTussocks();

	//
	bool success = true;
	success = SwapToTheRight();
	if( success )
		for( int i = 0; i < N; ++i )
		{
			if( !SwapToTheLeft() || !SwapToTheRight() )
			{
				success = false;
				break;
			}
		}

	//
	//printf( "\n%d\n", StepsCnt );
	if( success )
	{
		printf( "%d\n", StepsCnt );

		//char buf[ 300000 * 4 ];
		//buf[0] = 0;
		//for( int i = 0; i < StepsCnt-1; ++i )
		//	sprintf( buf, "%d ", Steps[i] );
		//printf( "%s", buf );
		//printf( "%d", Steps[StepsCnt-1] );

		for( int i = 0; i < StepsCnt-1; ++i )
			printf( "%d ", Steps[i] );
		printf( "%d", Steps[StepsCnt-1] );
	}
	else
		printf( "-1" );

	return 0;
}

